# $Id$
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=wcslib
pkgver=5.17
pkgrel=1
pkgdesc="A C library that implements the 'World Coordinate System' (WCS) standard in FITS"
arch=(i686 x86_64)
url="http://www.atnf.csiro.au/people/Mark.Calabretta/WCS/"
license=(GPL3)
depends=(cfitsio)
makedepends=(gcc-fortran)
source=("ftp://ftp.atnf.csiro.au/pub/software/$pkgname/$pkgname-$pkgver.tar.bz2")
sha256sums=('5c9cb5c86be01703f6488774ef3ea44fd6918a4dcdfddc70855905c05de8436c')

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr --without-pgplot
  make -j1
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install -j1

  # Fix wrong permissions
  chmod g=rx,-s "$pkgdir"/usr/{bin/,/lib/{,pkgconfig},share/man/man1/}
  chmod -s "$pkgdir"/usr/{include/wcslib-$pkgver/,share/doc/wcslib-$pkgver/{,html/}}
}
